from poium import Page,Element
import unittest
from selenium import webdriver
from time import sleep

class BaiduPage(Page):
    search_input = Element(id_="kw")
    search_button = Element(id_="su")
class TestBaidu(unittest.TestCase):
    def test_baidu_search(self):
        self.search_in_baidu('深圳')

    def search_in_baidu(self, keyword):
        self.driver = webdriver.Chrome()
        page = BaiduPage(self.driver)
        page.get("https://www.baidu.com")
        page.search_input = keyword
        page.search_button.click()
        sleep(5)
        self.driver.quit()

if __name__ =='__main__':
    unittest.main()